home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 October / 1984-10.d64 / quiz master (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  6KB  |  218 lines

  1. 10 rem quiz master
  2. 20 dimq$(100),a$(100),b$(100),c$(100),d$(100),e$(100),m$(15)
  3. 30 print"":poke53280,13:poke53281,5:goto50
  4. 40 poke198,6:poke631,30:poke632,34:poke633,34:poke634,20:poke635,5:return
  5. 50 poke53272,23:goto970
  6. 60 print"[147]":clr
  7. 70 dimq$(100),a$(100),b$(100),c$(100),d$(100),e$(100),m$(15),sn$(400),g(400)
  8. 80 gosub1830:gosub1360:gosub2070
  9. 90 print"[197]nter number of test to load:":inputn
  10. 100 ifn<0orn>xthenprint"[201]nvalid [210]ange":goto90
  11. 110 n$=m$(n):printspc(12)"[147]   [204][207][193][196][201][206][199][160][196][193][212][193][160][160][160]"
  12. 120 gosub1830:gosub2150:open2,8,2,+n$+" file,s,r":x=0
  13. 130 x=x+1
  14. 140 input#2,q$(x):input#2,a$(x):input#2,b$(x):input#2,c$(x):input#2,d$(x):input#2,e$(x)
  15. 150 ifst and64then170
  16. 160 goto130
  17. 170 close2:poke198,0:l=x:n=x:t=0
  18. 180 ifr=1then240
  19. 190 gosub2150:gosub2070:gosub1670
  20. 200 ifh=0then970
  21. 210 ifh=1then240
  22. 220 rem input questions
  23. 230 print"[147][197]nter [206]ame for [209]uiz":inputn$:gosub1460:n=0
  24. 240 n=n+1:print"[147]":printspc(13)" [209][213][201][218] [205][193][211][212][197][210] [146]"
  25. 250 print:print" [215][193][210][206][201][206][199]!  [196]o not exceed 80 [195]haracters  "
  26. 260 print:print"       [197]nter \ to exit routine          "
  27. 270 ifn>=100thenprint"[147]              [198][201][204][197][160][198][213][204][204]":fort=1to2000:next:goto980
  28. 280 gosub40
  29. 290 h=0
  30. 300 print"[197]nter [209]uestion #";n:print
  31. 310 inputq$(n)
  32. 320 ifq$(n)=""then310
  33. 330 ifq$(n)=chr$(92)thenn=n-1:goto770
  34. 340 iflen(q$(n))>80thengosub1290
  35. 350 ifh=1then240
  36. 360 print"[197]nter first answer:":print:gosub40:h=0
  37. 370 input"a. ";a$(n):ifa$(n)=""then370
  38. 380 ifasc(a$(n))=92thenn=n-1:goto770
  39. 390 a$(n)="a. "+a$(n)
  40. 400 iflen(a$(n))>80thengosub1290
  41. 410 ifh=1thengoto360
  42. 420 print"[197]nter second answer:":print:gosub40:h=0
  43. 430 input"b. ";b$(n):ifb$(n)=""then430
  44. 440 ifasc(b$(n))=92thenn=n-1:goto770
  45. 450 b$(n)="b. "+b$(n)
  46. 460 iflen(b$(n))>80thengosub1290
  47. 470 ifh=1thengoto420
  48. 480 print"[197]nter third answer:":print:gosub40:h=0
  49. 490 input"c. ";c$(n):ifc$(n)=""then490
  50. 500 ifasc(c$(n))=92thenn=n-1:goto770
  51. 510 c$(n)="c. "+c$(n)
  52. 520 iflen(c$(n))>80thengosub1290
  53. 530 ifh=1thengoto480
  54. 540 print"[197]nter fourth answer:":print:gosub40:h=0
  55. 550 input"d. ";d$(n):ifd$(n)=""then550
  56. 560 ifasc(d$(n))=92thenn=n-1:goto770
  57. 570 d$(n)="d. "+d$(n)
  58. 580 iflen(d$(n))>80thengosub1290
  59. 590 ifh=1thengoto540
  60. 600 print"[197]nter [204]etter of [195]orrect [193]nswer:":print:h=0
  61. 610 inpute$(n):ife$(n)=""then610
  62. 620 ifasc(e$(n))=92thenn=n-1:gosub770:goto990
  63. 630 iflen(e$(n))<>1thengosub1290
  64. 640 ife$(n)="a"then690
  65. 650 ife$(n)="b"then690
  66. 660 ife$(n)="c"then690
  67. 670 ife$(n)="d"then690
  68. 680 print" [197]rror: re-enter":goto610
  69. 690 ifh=1then600
  70. 700 ifp=1thenreturn
  71. 710 l=n:gosub2070:ifn=100then730
  72. 720 goto240
  73. 730 print:printspc(7)"[198]ile contains 100 [197]ntries."
  74. 740 print:print"[196]ata will be stored. [207]pen new text file"
  75. 750 gosub1720:gosub770:goto990
  76. 760 rem store data
  77. 770 gosub2070:printspc(10)" [215]ait, [211]toring [196]ata ":gosub2150
  78. 780 gosub1830:open2,8,2,"@0:"+n$+" file,s,w"
  79. 790 forx=1tol:print#2,q$(x):print#2,a$(x):print#2,b$(x):print#2,c$(x):print#2,d$(x):print#2,e$(x):next
  80. 800 close2:poke198,0:gosub2150:gosub2070:gosub1670:return
  81. 810 rem change answer
  82. 820 gosub2070:p=1:print"[147] [197]nter [206]umber of [209]uestion":inputw
  83. 830 print"[147]":s$=q$(w):gosub1190:s$=a$(w):gosub1190:s$=b$(w):gosub1190
  84. 840 s$=c$(w):gosub1190:s$=d$(w):gosub1190
  85. 850 print"[195]orrect answer is:":printe$(w)
  86. 860 gosub1670:n=w-1:gosub240:gosub770:return
  87. 870 rem review routine
  88. 880 gosub2070:y=1:print"[147]"
  89. 890 print:printtab(20-len(n$)/2);n$:gosub1670:print""
  90. 900 forn=1tol:print"[147]"
  91. 910 ifq$(n)=""thengoto960
  92. 920 s$=str$(n)+". "+q$(n):print:gosub1190
  93. 930 rem answer choices
  94. 940 s$=a$(n):gosub1190:s$=b$(n):gosub1190:s$=c$(n):gosub1190:s$=d$(n):gosub1190
  95. 950 print:print"[195]orrect answer is: ":printtab(7)e$(n):gosub2070
  96. 960 gosub1670:next:return
  97. 970 rem program menu
  98. 980 h=0
  99. 990 print"[147]":poke53280,13:poke53281,5
  100. 1000 gosub2070
  101. 1010 p=0
  102. 1020 printspc(13)" [209][213][201][218][160][205][193][211][212][197][210] "
  103. 1030 print:printspc(5)"[197]nter number of function:"
  104. 1040 print:printspc(8)"1. [197]nter [206]ew [209]uestions"
  105. 1050 print:printspc(8)"2. [210]eview [209]uestions"
  106. 1060 print:printspc(8)"3. [195]hange a [209]uestion"
  107. 1070 print:printspc(8)"4. [204]oad [208]revious [196]ata"
  108. 1080 print:printspc(8)"5. [193]dd to [212]est in [198]ile"
  109. 1090 print:printspc(8)"6. [201][206][201][212][201][193][204][201][218][197] [196]isk"
  110. 1100 print:printspc(8)"7. [197][206][196]"
  111. 1110 print:printspc(5)"[206]umber?"
  112. 1120 getg$:ifg$=""then1120
  113. 1130 g=asc(g$)-48:ifg<1org>8then1120
  114. 1140 onggosub230,880,820,60,1640,1730,1170
  115. 1150 goto990
  116. 1160 gosub2070
  117. 1170 poke198,0:sys198
  118. 1180 rem print justify
  119. 1190 print
  120. 1200 iflen(s$)<40thenprints$:goto1280
  121. 1210 x=40:y=1
  122. 1220 x=x-1
  123. 1230 ifasc(mid$(s$,x,y)+chr$(0))<>32then1220
  124. 1240 printleft$(s$,x)
  125. 1250 z=len(s$)
  126. 1260 z=z-x
  127. 1270 printright$(s$,z)
  128. 1280 return
  129. 1290 print"entry too long: re-phrase"
  130. 1300 h=1:fort=1to2000:next:return
  131. 1310 rem test title file
  132. 1320 print:print"has test title file been initiated?(y/n)":gosub2070
  133. 1330 getg$:ifg$=""then1330
  134. 1340 if g$="n"then1460
  135. 1350 ifg$<>"y"then1330
  136. 1360 print:printspc(17)" wait "
  137. 1370 gosub2150:gosub1830:open3,8,3,"test titles,s,r"
  138. 1380 x=0
  139. 1390 x=x+1:input#3,m$(x)
  140. 1400 ifst and64then1420
  141. 1410 goto1390
  142. 1420 close3:poke198,0:gosub2150
  143. 1430 ifs1<>0then2110
  144. 1440 print"[147]":printspc(14)"test titles":print
  145. 1450 fora=1tox:printa;". ";m$(a):next:return
  146. 1460 rem initiate test file
  147. 1470 ifx=15thengosub1710
  148. 1480 if x=15thenx=1
  149. 1490 ifx=1then1600
  150. 1500 print"[147][200]as file of test names been started?"
  151. 1510 getg$:ifg$=""then1510
  152. 1520 if g$="n"then1600
  153. 1530 ifg$="y"thengosub1370
  154. 1540 printx+1". "n$
  155. 1550 print"[201]s your title original?"
  156. 1560 getg$:ifg$=""then1560
  157. 1570 if g$="y"then1600
  158. 1580 print"[197]nter new title for test:"
  159. 1590 inputn$
  160. 1600 m$(x+1)=n$:gosub2070
  161. 1610 print:printspc(13)" [211]aving [212]itle "
  162. 1620 gosub1830:open3,8,3,"@0:test titles,s,w"
  163. 1630 fora=1tox+1:print#3,m$(a):next:close3:poke198,0:gosub2150:return
  164. 1640 rem test addition routine
  165. 1650 clr
  166. 1660 r=1:gosub70:r=0:goto990
  167. 1670 print:printtab(5)" [208][210][197][211][211][160][211][208][193][195][197][160][194][193][210][160][212][207][160][195][207][206][212][201][206][213][197] [146]"
  168. 1680 getg$:ifasc(g$+chr$(0))<>32then1680
  169. 1690 return
  170. 1700 print"[147]"
  171. 1710 printspc(10)"[147][198][201][204][197] [198][213][204][204]"
  172. 1720 fort=1to2000:next:return
  173. 1730 print"[147]  [196]o you want to initialize a new disk? ":printtab(17)" ([217]/[206]) "
  174. 1740 getg$:ifg$=""then1740
  175. 1750 ifg$="y"thenprint"type [199][207][212][207] 1790 and press [210][197][212][213][210][206]":end
  176. 1760 ifg$<>"n"then1740
  177. 1770 ifg$="n"thenreturn
  178. 1780 end
  179. 1790 print"[147]      [201]nsert [206]ew [196]isk into [196]rive
  180. 1800 [153]"  (NULL)ress any key when ready to proceed"
  181. 1810 [141]1820:[137]1850
  182. 1820 [161]g$:[139]g$[178]""[167]1820
  183. 1830 [159]15,8,15:[152]15,"i0:":[160]15:[142]
  184. 1840 [128]
  185. 1850 [143]  print"load (NULL)atnright$(NULL)1730
  186. 1860 print"                [215][193][210][206][201][206][199]!!!"
  187. 1870 print"   [196][201][211][203][160][201][206][160][196][210][201][214][197][160][201][211][160][193][194][207][213][212][160][212][207][160][194][197][160][197][210][193][211][197][196]!"
  188. 1880 print"  [160]       [160][193][210][197][160][217][207][213][160][211][213][210][197]? ([217]/[206])         "
  189. 1890 getg$:ifg$=""then1890
  190. 1900 ifg$="y"then1930
  191. 1910 ifg$="n"then990
  192. 1920 goto1890
  193. 1930 print"[147][197]nter [196][201][211][203][206][193][205][197]";:inputdn$
  194. 1940 iflen(dn$)>15thenprint"[206][193][205][197][160][212][207][207][160][204][207][206][199], [212][210][217][160][193][199][193][201][206]":fort=1to1000:next:goto1930
  195. 1950 print"[197]nter 2 [195]haracter disk [201].[196].":inputid$
  196. 1960 poke53281,2:poke53280,2:print"[147]          [204][193][211][212][160][195][200][193][206][195][197][160][212][207][160][211][212][207][208]!!!"
  197. 1970 print:print"         [208][210][197][211][211][160][193][206][217][160][203][197][217][160][212][207][160][211][212][207][20